const Service = require('egg').Service;

const _ = require('lodash')

class AppService extends Service {

    async page({ offset, limit, where }) {
        const { app: { model: { Contact, Customer } } } = this
        let ret = await Contact.findAndCountAll({
            include: [{
                model: Customer,
                require: false,
            }],
            offset,
            limit,
            where,
        })
        return ret
    }

}

module.exports = AppService
